[TypeError] Error calling method 'esAutorFoco(lotus.domino.local.Document)' on an object of type 'object [JavaScript Object]'
JavaScript code
1: var oDoc:NotesDocument = planNuevo.getDocument();
Looks like oDoc is not getting set to anything at this point, so the code is treating it as an unknown JavaScript object.
Where is planNuevo coming from / getting assigned? I would guess it's from the "var" variable of a view or repeat.
You could test it by trying to use it to compute a value in a ComputedText field (ex. planNuevo.getDocument().getNoteID() ) That is a simple test to make sure it really is getting a handle on a Notes document.